package shanhai.task;

import shanhai.callbackInterface.Callback;

public class Task {
    // 回调函数接口作为参数传递
    public void executeWithCallback(Callback callback) throws InterruptedException {
        // 模拟耗时操作
        Thread.sleep(1000);
        // 操作完成后调用回调函数
        callback.onComplete("task completed");
    }
}
